package com.wmz.disruptor.handler;

import com.lmax.disruptor.WorkHandler;
import com.wmz.disruptor.model.LongEvent;

/**
 * @author lihechun
 * @version 1.0
 * @description: 消费者：事件处理器2； WorkHandler实现多个消费者竞争情况
 * @date 2024/11/29 22:17
 */
public class LongEventWorkHandler2 implements WorkHandler<LongEvent> {

    @Override
    public void onEvent(LongEvent event) throws Exception {
        System.out.println(Thread.currentThread().getName() + "|" + Thread.currentThread().getStackTrace()[1].getFileName() + "：" + event.getValue());
    }
}
